let status = {
  stands: {
    modalModify: {
      isShow: false,
    },
    modalModifyHtml: {
      isShow: false,
    },
    modalModifySEO: {
      isShow: false,
    },
    modalModifyHtmlSEO: {
      isShow: false,
    },
    htmlEditor: {
      isShow: false,
    }
  },
  booth: {
    modalAdd: {
      isShow: false,
    },
    modalModify: {
      isShow: false,
    },
  },
  products: {
    modalAdd: {
      isShow: false,
    },
    modalModify: {
      isShow: false,
    },
    modalSequence: {
      isShow: false,
    }
  },
  modalSort: {
    isShow: false,
    isLoading: true,
  },
  modalParents: {
    isShow: false,
  },
  modalChildren: {
    isShow: false,
    okText: "发布",
    type: 1,//1.直接修改展厅状态为发布(APP) 2.生成页面临时文件并修改展厅状态为预览(PC和通用) 3.生成页面并修改展厅状态为发布(PC和通用)
  },
};

let params = {
  //boothList查询参数
  searchParam: {
    booth: {
      showroomId: "",
      displayType: 0,
      platforms: [1,2,3],
    },
    addedProducts: {
      collectionId: "",
      search: "", //编号或名称
      categoryId: "",
      categoryLevel: null,
      state: null,
      selectedDate: null,
      startTime: null,
      endTime: null,
    },
  },
  //修改表单参数
  editParam: {
    //展厅
    stands: {
      id: "",
      title: "",
      subtitle: "",
      description: "",
      name: "",
      platform: 0,
      type: 0,
      // state: null,
      shortLink: "",
      shortLinkName: "",
      tags: [],
      note: "",
      hasProductArea: false,
      classificationLevel: 0,
      classificationId: "",
      categoryList: [],
      collectionId: "",
      collectionTitle: "",
      collectionType: 2,
      collectionClassificationId: "",
      collectionKeyword: "",
      collectionFilters: [],
      disableSeo: false,
      collectionHasCategory:false,
      collectionHasKeyword:false,
      collectionHasDate:false,
      collectionPublishedStartDate:'',
      collectionPublishedEndDate:'',
      collectionReturnFilters: [],
    },
    booth: {
      id:"",
      modifyingTime: 0,
    },
    product: {
      collectionId: "",
      productId: "",
      sequence: 0,
    },
    htmlStands: {
      id: "",
      name: "",
      platform: 3,
      type: 400,
      // state: null,
      shortLink: "",
      shortLinkName: "",
      tags: [],
      note: "",
      disableSeo: false,
    },
  },
  //新增表单参数
  addParam: {
    //展区
    booth: {
      showroomId: "",
      displayType: 1,
      platform: 3,
      title: "",
      subtitle: "",
      sequence: 10,
      columnPc: 1,
      columnMobile: 1,
      widthPc: 100,
      heightPc: 100,
      widthMobile: 100,
      heightMobile: 100,
      rowNumber: null,
      note: "",
      htmlContent: "",
      isCodeEdit: false,
    },
    products: {
      collectionId: "",
      productIds: [],
      sequence: 10000,
    },
  },
  //下线时父级展厅参数
  parentsParam: {
    showroomId: "",
    currentTime: 0,
  },
  childrenParam: {
    showroomId: "",
    currentTime: 0,
  },
  htmlPageParam: {
    id: "",
    showroomId: "",
    content: "",
    isCodeEdit: false,
  }
};

let data = {
  baseInfo: {
    id: "",
    title: "",
    subtitle: "",
    description: "",
    name: "",
    platform: 0,
    type: 0,
    state: 0,
    publishState: 0,
    shortLink: "",
    shortLinkName: "",
    tags: [],
    note: "",
    createtime: 0,
    lastModifyTime: 0,
    lastPublishTime: 0,
    hasProductArea: false,
    classificationLevel: 0,
    classificationId: "",
    categoryList: [],
    pageMetaInfos: [],
    collectionId: "",
    collectionTitle: "",
    collectionType: 0,
    collectionKeyword: "",
    collectionFilters: [],
    disableSeo: false,
    collectionHasCategory:false,
    collectionHasKeyword:false,
    collectionHasDate:false,
    collectionPublishedStartDate:'',
    collectionPublishedEndDate:'',
    collectionClassificationId:'',
    collectionReturnFilters: [],
  },
  htmlBaseInfo: {
    id: "",
    name: "",
    platform: 3,
    type: 400,
    state: 0,
    publishState: 0,
    shortLink: "",
    shortLinkName: "",
    tags: [],
    note: "",
    createtime: 0,
    lastModifyTime: 0,
    lastPublishTime: 0,
    disableSeo: false,
    pageMetaInfos: [],
  },
  boothList: [],
  productAddedList: [],
  productAllAddedList: [],
  htmlPage: {
    id: "",
    showroomId: "",
    content: "",
    isCodeEdit: false,
  },
};

let sortTableTitles=function (self) {
  return [
    {
      title: '序号',
      key: 'sequence',
      align: 'center',
      width: 100,
    },
    {
      title: '产品主图',
      key: 'productImg',
      align: 'center',
      width: 130,
      render: (h, params) => {
        let imageUrl = params.row.product.productImg==null?"": params.row.product.productImg;
        return '' == imageUrl ? '' : h('img', {
          attrs: {src: imageUrl, height: 60},
        })
      },
    },
    {
      title: '产品编号',
      key: 'code',
      align: 'center',
      width: 200,
      render: (h, params) => {
        return  h('div',params.row.product.code)
      },
    },
    {
      title: '产品名称',
      key: 'name',
      align: 'center',
      render: (h, params) => {
        return  h('div',params.row.product.name)
      },
    },
   {
    title: '状态',
      width:100,
      key: 'state',
      render: (h, params) => {
      return (
        <div>
          <tag color={self.getProductStateColor(params.row.product.state)} >{self.getProductState(params.row.product.state)}</tag>
        </div>
      );
    }, align: 'center'
  }
  ]
};

let page = {
  productsAddedPage: {
    total: 0,
    pageNum: 1,
    pageSize: 40,
    options: [40, 60, 80, 120],
  }
}

export default {
  tStatus: status,
  tParam: params,
  tData: data,
  tPage: page,
  sortTableTitles:sortTableTitles,
};
